Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: date format of log should not show signatures #2835

Merged
merged 2 commits into from
Mar 25, 2023

Conversation

vbatts
Copy link
Contributor

@vbatts vbatts commented Mar 24, 2023

Summary

if user's have git configurations like git config --global log.showSignature=true it will cause an issue in the Makefile variable output, like:

vbatts@possibly:~/src/github.com/sigstore/cosign$ make
[288/1916] /bin/sh: 1: Syntax error: "(" unexpected
CGO_ENABLED=0 go build -trimpath -ldflags "-buildid= -X sigs.k8s.io/release-utils/version.gitVersion=v2.0.0-63-ge71faa1a -X sigs.k8s.io/release-utils/version.gitCommit=e71faa1af0383d860481f569ef2c01694d37b00b -X sigs.k8s.io/release-utils/version.gitTreeState="clean" -X sigs.k8s.io/release-utils/version.buildDate=" -o cosign ./cmd/cosign

Fixes #2834

Now it runs clean if this corner case happens:

vbatts@possibly:~/src/github.com/sigstore/cosign$ make
+ go env GOBIN
+ git diff --quiet
+ '[' 1 -eq 1 ']'
+ echo 1
+ find cmd -iname '*.go'
+ find pkg -iname '*.go'
+ find cmd -iname '*.go'
+ find pkg -iname '*.go'
+ git describe --tags --always --dirty
+ git rev-parse HEAD
+ git -c log.showSignature=false log -1 --pretty=%ct
+ git -c log.showSignature=false log -1 --pretty=%ct
+ date -u -d @1679669412 +%Y-%m-%dT%H:%M:%SZ
CGO_ENABLED=0 go build -trimpath -ldflags "-buildid= -X sigs.k8s.io/release-utils/version.gitVersion=v2.0.0-64-gbb9af6bb-dirty -X sigs.k8s.io/release-utils/version.gitCommit=bb9af6bb1323c116e3b6b6149770aaea92ca7a95 -X sigs.k8s.io/release-utils/version.gitTreeState="dirty" -X sigs.k8s.io/release-utils/version.buildDate=2023-03-24T14:50:12Z" -o cosign ./cmd/cosign
+ CGO_ENABLED=0
+ go build -trimpath -ldflags '-buildid= -X sigs.k8s.io/release-utils/version.gitVersion=v2.0.0-64-gbb9af6bb-dirty -X sigs.k8s.io/release-utils/version.gitCommit=bb9af6bb1323c116e3b6b6149770aaea92ca7a95 -X sigs.k8s.io/release-utils/version.gitTreeState=dirty -X sigs.k8s.io/release-utils/version.buildDate=2023-03-24T14:50:12Z' -o cosign ./cmd/cosign

Release Note

Documentation

znewman01
znewman01 previously approved these changes Mar 25, 2023
Copy link
Contributor

@znewman01 znewman01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makefile Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 25, 2023

Codecov Report

Merging #2835 (2ed0492) into main (e71faa1) will decrease coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             main    #2835      +/-   ##
==========================================
- Coverage   29.51%   29.47%   -0.04%     
==========================================
  Files         151      151              
  Lines        9666     9678      +12     
==========================================
  Hits         2853     2853              
- Misses       6374     6386      +12     
  Partials      439      439              

see 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

if user's have git configurations like `git config --global log.showSignature=true`
it will cause an issue in the Makefile variable output, like:
```shell
vbatts@possibly:~/src/github.com/sigstore/cosign$ make
[288/1916] /bin/sh: 1: Syntax error: "(" unexpected
CGO_ENABLED=0 go build -trimpath -ldflags "-buildid= -X sigs.k8s.io/release-utils/version.gitVersion=v2.0.0-63-ge71faa1a -X sigs.k8s.io/release-utils/version.gitCommit=e71faa1af0383d860481f569ef2c01694d37b00b -X sigs.k8s.io/release-utils/version.gitTreeState="clean" -X sigs.k8s.io/release-utils/version.buildDate=" -o cosign ./cmd/cosign
```

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
@vbatts
Copy link
Contributor Author

vbatts commented Mar 25, 2023

updated PTAL

@cpanato cpanato enabled auto-merge (squash) March 25, 2023 17:02
@cpanato cpanato merged commit 486edb9 into sigstore:main Mar 25, 2023
@github-actions github-actions bot added this to the v1.14.0 milestone Mar 25, 2023
@vbatts vbatts deleted the quiet_log_output branch March 25, 2023 17:30
dmitris pushed a commit to dmitris/cosign that referenced this pull request Mar 27, 2023
* Makefile: date format of log should not show signatures

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>

* Makefile: add the ability to DEBUG the `make` build

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>

---------

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
dmitris pushed a commit to dmitris/cosign that referenced this pull request Mar 27, 2023
* Makefile: date format of log should not show signatures

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>

* Makefile: add the ability to DEBUG the `make` build

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>

---------

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
dmitris pushed a commit to dmitris/cosign that referenced this pull request Mar 27, 2023
* Makefile: date format of log should not show signatures

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>

* Makefile: add the ability to DEBUG the `make` build

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>

---------

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

user git configuration for signatures will affect build variables
3 participants